package com.ddstation.hzsc_invs.autonomy_examination.service;

import com.ddstation.crud.entity.DtInvsAutonomyExaminationInstitutionDataEntity;
import com.ddstation.hzsc_invs.autonomy_examination.mapper.DtInvsAutonomyExaminationInstitutionDataMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.inject.Inject;
import java.util.List;
import java.util.Map;

/**
 * @author gqw
 * @date 2020-11-24
 */
@Service
public class DtInvsAutonomyExaminationInstitutionDataServiceImpl implements DtInvsAutonomyExaminationInstitutionDataService{
    @Inject
    private DtInvsAutonomyExaminationInstitutionDataMapper dtInvsAutonomyExaminationInstitutionDataMapper;
    @Override
    public List<DtInvsAutonomyExaminationInstitutionDataEntity> list(Map<String, Object> map) {
        return dtInvsAutonomyExaminationInstitutionDataMapper.list(map);
    }

    @Override
    public int count(Map<String, Object> map) {
        return dtInvsAutonomyExaminationInstitutionDataMapper.count(map);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public int insertData(Integer type, Integer year, Integer quarter) {
        return dtInvsAutonomyExaminationInstitutionDataMapper.insertData(type, year, quarter);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public int updateDataDaily() {
        return dtInvsAutonomyExaminationInstitutionDataMapper.updateDataDaily();
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public int updateDataOverall() {
        return dtInvsAutonomyExaminationInstitutionDataMapper.updateDataOverall();
    }

    /**
     * 执法机构 储存 （去重）
     * @return
     */
    @Override
    public int insertInstitution() {
        return dtInvsAutonomyExaminationInstitutionDataMapper.insertInstitution();
    }

    /**
     * 根据执法数据 更新执法状态
     * @return
     */
    @Override
    public int updateEnforcement() {
        return dtInvsAutonomyExaminationInstitutionDataMapper.updateEnforcement();
    }
}
